import axios from 'axios';

const DEEPSEEK_API_URL = 'http://140.210.32.46:7861/chat';
// const DEEPSEEK_API_KEY = '';

export default {
  containers: async (params?: any) => {
    const { data } = await axios.get(`test`, { params });
    return data;
  },

  async callDeepSeekAPI(query: string, history: any[] = [], model: string = 'glm4', stream: boolean = false) {
    try {
      const response = await axios.post(`${DEEPSEEK_API_URL}/knowledge_base_chat`, {
        query,
        history,
        model,
        stream,
        "mode": "local_kb",
        "kb_name": "kms_new",
        "level": "0",
        "top_k": 3,
        "score_threshold": 2,
        "temperature": 0.7,
        "max_tokens": 0,
        "prompt_name": "default",
        "return_direct": false
      });
      return response.data;
    } catch (error) {
      console.error('Error calling DeepSeek API:', error);
      return null;
    }
  }
};

